#include<stdio.h>
#include<unistd.h>
#include<string.h>
int main()
{
    int i=0;
    char bar[102];
    memset(bar,0,sizeof(bar));
    const char* s="|/-\\";
    while(i<=100)
    {
        printf("[%-100s][%-3d%%][%c]\r",bar,i,s[i%4]);
        fflush(stdout);
        bar[i++]='#';
        usleep(30000);
    }
    printf("\n");
    return 0;
}
